<template>
  <router-view></router-view>
</template>

<script>
import { keepAliveMaxNum } from '@/config/settings'
import { mapGetters } from 'vuex'

export default {
  name: 'SubLayout',
  data() {
    return {
      route: {},
      keepAliveMaxNum,
      routerView: true,
    }
  },
  created() {
    // console.log(this.$route)
    // this.route = this.$route
  },
  computed: {
    ...mapGetters({
      visitedRoutes: 'tagsBar/visitedRoutes',
    }),
    cachedRoutes() {
      const cachedRoutesArr = []
      this.visitedRoutes.forEach(item => {
        if (!item.meta.noKeepAlive) {
          cachedRoutesArr.push(item.name)
        }
      })
      console.log(cachedRoutesArr)
      return cachedRoutesArr
    },
    key() {
      return this.$route.path
    },
  },
}
</script>
